package com.example.spring.bean.load09inject;


import org.springframework.beans.factory.annotation.Value;

/**
 * 使用 @Value 赋值
 */
class Mail {

    @Value("${mail.name:master}")
    private String name;

    @Value("${mail.host}")
    private String host;

    /**
     * 直接赋默认值
     */
    @Value("hello")
    private String tt;

    private String from;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getTt() {
        return tt;
    }

    public void setTt(String tt) {
        this.tt = tt;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    @Override
    public String toString() {
        return "Mail{" +
                "name='" + name + '\'' +
                ", host='" + host + '\'' +
                ", tt='" + tt + '\'' +
                ", from='" + from + '\'' +
                '}';
    }
}
